package vsy.buzzwordbingo.sort;

import vsy.buzzwordbingo.model.Player;

public class PlayerNameComparator extends OrderedComparator<Player> {
	public PlayerNameComparator(Order order) {
		super(order);
	}

	@Override
	public int orderedCompare(Player p1, Player p2) {
		if (p1.getName() == null || p2.getName() == null)
			return nullCompare(p1.getName(), p2.getName());
		
		return p1.getName().compareTo(p2.getName());
	}
}
